package com.glqiang.controller;

import com.glqiang.domain.entity.User;
import com.glqiang.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author glqiang
 * @date 2022/11/21 00:55
 */
@RestController
public class TestController {

    @Autowired
    private UserService userService;

    @RequestMapping("/test")
    @PreAuthorize("hasAuthority('content:user:list1')")
    public String test() {
        List<User> list = userService.list();
        return list.toString();
    }
}
